#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

vector<int> add(vector<int> &num)
{
    vector<int> ans;
    int carry = 1, sum = 0;
    reverse(num.begin(), num.end());
    for (int i = 0; i < num.size(); i++) {
        sum = num[i] + carry;
	carry = sum/10;
	sum = sum%10;
	ans.push_back(sum);
    }
    if (carry) ans.push_back(carry);
    reverse(ans.begin(), ans.end());
    return ans;
}


int main(int argc, char **argv)
{
    int a[] = {6,9,9};
    vector<int> num(a, a + sizeof(a)/sizeof(int));
    vector<int> result = add(num);
    for (int i = 0; i < result.size(); i++)
        cout << result[i] << " ";

}
